package com.huayanginfo.saas.member;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.huayanginfo.saas.support.BaseAction;

public class LogoutAction extends BaseAction{
	private static final long serialVersionUID = -8473328250998982058L;

	@Override
	public String execute() throws Exception{
		HttpServletResponse response = ServletActionContext.getResponse();
		Cookie[] cookies = ServletActionContext.getRequest().getCookies();
		for (Cookie cookie : cookies) {
			if (cookie.getName().equals("el")) {
				cookie.setMaxAge(0);
				response.addCookie(cookie); 
			}
		}
		return SUCCESS;
	}
}
